{{ include './header.html'}}

<body>
  <div id="wrap">
    {{ include './left.html'}}
    <!-- 右侧具体内容栏目 -->
    <div id="rightContent">
      <div id="personInfor" style="text-align: right; background-color:blanchedalmond;">
        <p id="userName">
          <a> 用户:{{adminname}} </a>
          <a href="/admin/login/loginout">退出</a>
        </p>
      </div>

      <!-- Tab panes -->
        <!-- 用户管理模块 -->
        <div role="tabpanel" class="tab-pane" id="user">

          <div class="check-div form-inline">
            <div class="col-xs-3"></div>
            <div class="col-xs-4">
              <input type="text" id="username" class="form-control input-sm" placeholder="输入文字搜索">
              <button class="btn btn-white btn-xs " onclick="findUser()">查 询 </button>
            </div>
          </div>
          
          <div class="data-div">
            <div class="row tableHeader">
              <div class="col-xs-2 ">
                用户名
              </div>
              <div class="col-xs-2 ">
                头像
              </div>
              <div class="col-xs-2">
                打印份数
              </div>
              <div class="col-xs-2">
                文件个数
              </div>
              <div class="col-xs-4">
                注册时间
              </div>
            </div>
        
            <div class="tablebody">
              <% for(var i=0; i<userlist.length; i++) {%>
                <div class="row">
                  <div class="col-xs-2 ">
                    <%= userlist[i].name %>
                  </div>
                  <div class="col-xs-2 ">
                    <img src="{{userlist[i].avatar}}" style="height: auto; width: auto; max-width: 30%; max-height: 30%;" />
                  </div>
                  <div class="col-xs-2">
                    <%= userlist[i].printNumber %>
                  </div>
                  <div class="col-xs-2">
                    <%= userlist[i].fileNumber %>
                  </div>
                  <div class="col-xs-4">
                    <%= userlist[i].date %>
                  </div>
                </div>
                <% } %>
            </div>
            <div class="pagination" id="pagination" style="float: right; background-color: cornflowerblue; "></div>
        
          </div>
          <script type="text/javascript" src="../../js/jqPaginator.js"></script>
          <script>
            $('#pagination').jqPaginator({
              totalPages: {{ usertotalPages }},
              visiblePages: 8,
              currentPage: {{ currentPage }},
              onPageChange: function (num, type) {
                console.log(num, type)
                if (type == 'change') {
                  location.href = "/admin/index/usernextpage?page=" + num
                }
              }
            })
           
          </script>
          <script>
            function findUser() {
                data = $('#username').val()
                location.href = "/admin/index/findUser?username=" + data
              }
          </script>
          <!--页码块-->
               
      </div>
    </div>
  </div>

</body>

</html>